package com.jessechanrui.template.skeleton.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.data.domain.AuditorAware;

import java.util.Optional;

/**
 * @author chenrui
 * @date 2024/3/7
 */
@Configuration
public class UserIdAuditorBean  implements AuditorAware<String> {

    @Override
    public Optional<String> getCurrentAuditor() {
        //根据登录用户的上下文获取用户，以进行数据库字段的变更
        return Optional.of("admin");
    }
}
